'''
结论，子类父类的关系与C#，Java的一致
'''

class Animal(object):
    def __init__(self,classname='Animal'):
        self.__classname = classname
    def run(self):
        print('{} is running...'.format(self.__classname))

class Dog(Animal):
    def __init__(self):
        Animal.__init__(self,classname='Dog');

class Cat(Animal):
    def __init__(self):
        Animal.__init__(self,classname='Cat');
#

dog1 = Dog();
cat1 = Cat();
animal1 = Animal();
print(isinstance(dog1,Dog))			#输出：True
print(isinstance(dog1,Animal))		#输出：True
print(isinstance(cat1,Cat))			#输出：True
print(isinstance(cat1,Animal))		#输出：True
print(isinstance(animal1,Animal))	#输出：True
print(isinstance(animal1,Dog))		#输出：False
print(isinstance(animal1,Cat))		#输出：False


def run(animal):
	animal.run();
#
run(animal1);#输出：Animal is running...
run(dog1);	 #输出：Dog is running...
run(cat1);	 #输出：Cat is running...




